# frozen_string_literal: true
json.array! @interviews do |interview|
  json.extract! interview, :id, :entered_at, :exited_at, :car_code, :access_code, :door_name, :keyword, :reason, :flag

  json.building_name interview.building.code
  json.user_name interview.user.name
  json.guest_name interview.guest.idcard.name
  json.village_name interview.village.name
end

#  id          :integer          not null, primary key
#  village_id  :integer
#  building_id :integer
#  user_id     :integer
#  guest_id    :integer
#  entered_at  :datetime
#  exited_at   :datetime
#  car_code    :string
#  access_code :string
#  door_name   :string
#  keyword     :string
#  reason      :string
#  flag        :boolean          default("true")
#  created_at  :datetime         not null
#  updated_at  :datetime         not null